import 'package:flutter/material.dart';
import '../../utils/Global.dart';
import 'PurchaseCourse.dart';

class Study extends StatefulWidget {
  const Study({Key? key}):super(key: key);
  @override
  State<Study> createState() => _StudyState();
}

class _StudyState extends State<Study> {
  List courseList = [];
  @override
  void initState() {
    G.api.course.courseList().then((res) {
      // print(res);
      setState(() {
        courseList = res;
      });
    });
    // TODO: implement initState
    super.initState();
  }
  @override
  Widget build(BuildContext context) {
    return CustomScrollView(
      slivers: [
        SliverPadding(
          padding: EdgeInsets.all(5),
          sliver: PurchaseCourse(courseList: courseList),
        )
      ],
    );
  }
}